<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>RT-Thread RTOS: Inter-Thread Communication</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RT-Thread RTOS
   &#160;<span id="projectnumber">1.2.0</span>
   </div>
   <div id="projectbrief">An open source embedded real-time operating system</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___i_p_c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Inter-Thread Communication<div class="ingroups"><a class="el" href="group___kernel.html">RT-Thread Kernel API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__ipc__object.html">rt_ipc_object</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__semaphore.html">rt_semaphore</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__mutex.html">rt_mutex</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__mailbox.html">rt_mailbox</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__messagequeue.html">rt_messagequeue</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga1b618f6714ea8f49a45ea4d105aaf5d5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga1b618f6714ea8f49a45ea4d105aaf5d5">RT_IPC_FLAG_FIFO</a>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:ga1b618f6714ea8f49a45ea4d105aaf5d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga296aeeb69fe2c8c5012e1059df4364a6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga296aeeb69fe2c8c5012e1059df4364a6">RT_IPC_FLAG_PRIO</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:ga296aeeb69fe2c8c5012e1059df4364a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae7ea862e2d1edce01e015bdffe49d586"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gae7ea862e2d1edce01e015bdffe49d586">RT_IPC_CMD_UNKNOWN</a>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:gae7ea862e2d1edce01e015bdffe49d586"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga947606ce2a31a2d70e287c38a09dab3b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga947606ce2a31a2d70e287c38a09dab3b">RT_IPC_CMD_RESET</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:ga947606ce2a31a2d70e287c38a09dab3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga923d8e409f9daa8843978d6805ebcdeb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga923d8e409f9daa8843978d6805ebcdeb">RT_WAITING_FOREVER</a>&#160;&#160;&#160;-1</td></tr>
<tr class="separator:ga923d8e409f9daa8843978d6805ebcdeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga78a487898fe750a9f7e9c37911fbe7cb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga78a487898fe750a9f7e9c37911fbe7cb">RT_WAITING_NO</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga78a487898fe750a9f7e9c37911fbe7cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga449614d0024ade7e81e53462bce12a60"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga449614d0024ade7e81e53462bce12a60">RT_EVENT_FLAG_AND</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:ga449614d0024ade7e81e53462bce12a60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1685d2d8ef3af705fdc297405eda02ba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga1685d2d8ef3af705fdc297405eda02ba">RT_EVENT_FLAG_OR</a>&#160;&#160;&#160;0x02</td></tr>
<tr class="separator:ga1685d2d8ef3af705fdc297405eda02ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1c42d6c619445f9151e76c3242ef052"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gaf1c42d6c619445f9151e76c3242ef052">RT_EVENT_FLAG_CLEAR</a>&#160;&#160;&#160;0x04</td></tr>
<tr class="separator:gaf1c42d6c619445f9151e76c3242ef052"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacb55d0444383689161388fe89f415e92"><td class="memItemLeft" align="right" valign="top">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gacb55d0444383689161388fe89f415e92">rt_ipc_object_init</a> (struct <a class="el" href="structrt__ipc__object.html">rt_ipc_object</a> *ipc)</td></tr>
<tr class="separator:gacb55d0444383689161388fe89f415e92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76ac02d6065733bd88ad9c225d17d7cc"><td class="memItemLeft" align="right" valign="top">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga76ac02d6065733bd88ad9c225d17d7cc">rt_ipc_list_suspend</a> (rt_list_t *list, struct <a class="el" href="structrt__thread.html">rt_thread</a> *thread, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga76ac02d6065733bd88ad9c225d17d7cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3305383c1afa8b8d6077d9a43fc05697"><td class="memItemLeft" align="right" valign="top">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga3305383c1afa8b8d6077d9a43fc05697">rt_ipc_list_resume</a> (rt_list_t *list)</td></tr>
<tr class="separator:ga3305383c1afa8b8d6077d9a43fc05697"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9aff869d3f5db5c1788b45bb6feb9b4f"><td class="memItemLeft" align="right" valign="top">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga9aff869d3f5db5c1788b45bb6feb9b4f">rt_ipc_list_resume_all</a> (rt_list_t *list)</td></tr>
<tr class="separator:ga9aff869d3f5db5c1788b45bb6feb9b4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga023e00dd1ae86ddbeb2dbf92771e17ea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga023e00dd1ae86ddbeb2dbf92771e17ea">rt_sem_init</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem, const char *name, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> value, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga023e00dd1ae86ddbeb2dbf92771e17ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7dd3560a50be21e132c71f622870c500"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga7dd3560a50be21e132c71f622870c500">rt_sem_detach</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem)</td></tr>
<tr class="separator:ga7dd3560a50be21e132c71f622870c500"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61a4960ff4a173f1d1c35ede42e1227f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga61a4960ff4a173f1d1c35ede42e1227f">rt_sem_create</a> (const char *name, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> value, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga61a4960ff4a173f1d1c35ede42e1227f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e45d2b96aab649832b6756d68629bbe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga0e45d2b96aab649832b6756d68629bbe">rt_sem_delete</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem)</td></tr>
<tr class="separator:ga0e45d2b96aab649832b6756d68629bbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaad0807b1eb15fe12a67de122e28f20eb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gaad0807b1eb15fe12a67de122e28f20eb">rt_sem_take</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> time)</td></tr>
<tr class="separator:gaad0807b1eb15fe12a67de122e28f20eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf24da991e29df68a49062d89b95c7de5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gaf24da991e29df68a49062d89b95c7de5">rt_sem_trytake</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem)</td></tr>
<tr class="separator:gaf24da991e29df68a49062d89b95c7de5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad9a5760bc4c7faeb08a7d9c112506f76"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gad9a5760bc4c7faeb08a7d9c112506f76">rt_sem_release</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem)</td></tr>
<tr class="separator:gad9a5760bc4c7faeb08a7d9c112506f76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f05b6881e0d7c456b7bc1412fa73392"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga4f05b6881e0d7c456b7bc1412fa73392">rt_sem_control</a> (<a class="el" href="structrt__semaphore.html">rt_sem_t</a> sem, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:ga4f05b6881e0d7c456b7bc1412fa73392"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga90c29e470fff8981a976ec7f9bb0546e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga90c29e470fff8981a976ec7f9bb0546e">rt_mutex_init</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex, const char *name, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga90c29e470fff8981a976ec7f9bb0546e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7a8b48c0e6884e2c22d08e9e7e98a613"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga7a8b48c0e6884e2c22d08e9e7e98a613">rt_mutex_detach</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex)</td></tr>
<tr class="separator:ga7a8b48c0e6884e2c22d08e9e7e98a613"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ce96ed48d83086aab6ecadebac6d0c6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga5ce96ed48d83086aab6ecadebac6d0c6">rt_mutex_create</a> (const char *name, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga5ce96ed48d83086aab6ecadebac6d0c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a74f51362fc566500bec135599dd5a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga8a74f51362fc566500bec135599dd5a9">rt_mutex_delete</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex)</td></tr>
<tr class="separator:ga8a74f51362fc566500bec135599dd5a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77845c9c0da68d07225c4c4699f114f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga77845c9c0da68d07225c4c4699f114f0">rt_mutex_take</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> time)</td></tr>
<tr class="separator:ga77845c9c0da68d07225c4c4699f114f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad49c2ee6dc578e6687919f01a4ac5137"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gad49c2ee6dc578e6687919f01a4ac5137">rt_mutex_release</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex)</td></tr>
<tr class="separator:gad49c2ee6dc578e6687919f01a4ac5137"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadf759ed1d28b25c78893aa4236e2e7b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gadf759ed1d28b25c78893aa4236e2e7b5">rt_mutex_control</a> (<a class="el" href="structrt__mutex.html">rt_mutex_t</a> mutex, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:gadf759ed1d28b25c78893aa4236e2e7b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0fad38227b1ebd616a807a09f2eb772"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gab0fad38227b1ebd616a807a09f2eb772">rt_event_init</a> (rt_event_t event, const char *name, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:gab0fad38227b1ebd616a807a09f2eb772"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43f0b137c7e6d5c2152f6b1d39b57616"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga43f0b137c7e6d5c2152f6b1d39b57616">rt_event_detach</a> (rt_event_t event)</td></tr>
<tr class="separator:ga43f0b137c7e6d5c2152f6b1d39b57616"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d752d98e73c0adcdd2b0df24e67efdb"><td class="memItemLeft" align="right" valign="top">rt_event_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga3d752d98e73c0adcdd2b0df24e67efdb">rt_event_create</a> (const char *name, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga3d752d98e73c0adcdd2b0df24e67efdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga840d6210713f186fe248a032a68d5e6d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga840d6210713f186fe248a032a68d5e6d">rt_event_delete</a> (rt_event_t event)</td></tr>
<tr class="separator:ga840d6210713f186fe248a032a68d5e6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga92efdf32aaf073d733f3bafd02d730e5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga92efdf32aaf073d733f3bafd02d730e5">rt_event_send</a> (rt_event_t event, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> set)</td></tr>
<tr class="separator:ga92efdf32aaf073d733f3bafd02d730e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77e0517918bc7dabd458c2a751a59263"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga77e0517918bc7dabd458c2a751a59263">rt_event_recv</a> (rt_event_t event, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> set, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> option, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> timeout, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> *recved)</td></tr>
<tr class="separator:ga77e0517918bc7dabd458c2a751a59263"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafb0ca02b1983270b2cc911d6c5682ed0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gafb0ca02b1983270b2cc911d6c5682ed0">rt_event_control</a> (rt_event_t event, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:gafb0ca02b1983270b2cc911d6c5682ed0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac05bd0c179f754c32f83a7b013e8953b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gac05bd0c179f754c32f83a7b013e8953b">rt_mb_init</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb, const char *name, void *msgpool, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> size, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:gac05bd0c179f754c32f83a7b013e8953b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3312c6094d9c21af33a74f444a8c5993"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga3312c6094d9c21af33a74f444a8c5993">rt_mb_detach</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb)</td></tr>
<tr class="separator:ga3312c6094d9c21af33a74f444a8c5993"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7719d644b6f58399894dec1c6353ac37"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga7719d644b6f58399894dec1c6353ac37">rt_mb_create</a> (const char *name, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> size, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga7719d644b6f58399894dec1c6353ac37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga71e9e49401cbbed83515ace6fa13c27b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga71e9e49401cbbed83515ace6fa13c27b">rt_mb_delete</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb)</td></tr>
<tr class="separator:ga71e9e49401cbbed83515ace6fa13c27b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab212d0f70fbf7ac83a2ba6b1f5e4e938"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gab212d0f70fbf7ac83a2ba6b1f5e4e938">rt_mb_send_wait</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> value, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> timeout)</td></tr>
<tr class="separator:gab212d0f70fbf7ac83a2ba6b1f5e4e938"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9d800aa0faa0ab5ccd3b0e75837db047"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga9d800aa0faa0ab5ccd3b0e75837db047">rt_mb_send</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> value)</td></tr>
<tr class="separator:ga9d800aa0faa0ab5ccd3b0e75837db047"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga363ad0b0f09a2b1f62dad79199c4d717"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga363ad0b0f09a2b1f62dad79199c4d717">rt_mb_recv</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb, <a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> *value, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> timeout)</td></tr>
<tr class="separator:ga363ad0b0f09a2b1f62dad79199c4d717"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaebd2849f8d9fcc6645191eb22508e798"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gaebd2849f8d9fcc6645191eb22508e798">rt_mb_control</a> (<a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> mb, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:gaebd2849f8d9fcc6645191eb22508e798"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac5b76df894964c908271ab0951f7e86"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gaac5b76df894964c908271ab0951f7e86">rt_mq_init</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq, const char *name, void *msgpool, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> msg_size, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> pool_size, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:gaac5b76df894964c908271ab0951f7e86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1ed6238494fac3ab081a90d9c563a8f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga1ed6238494fac3ab081a90d9c563a8f3">rt_mq_detach</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq)</td></tr>
<tr class="separator:ga1ed6238494fac3ab081a90d9c563a8f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35acff654ecee2a76d5555e9683d8470"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga35acff654ecee2a76d5555e9683d8470">rt_mq_create</a> (const char *name, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> msg_size, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> max_msgs, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> flag)</td></tr>
<tr class="separator:ga35acff654ecee2a76d5555e9683d8470"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbf0bfedc6677ca8357d8b345c9026c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#gacbf0bfedc6677ca8357d8b345c9026c9">rt_mq_delete</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq)</td></tr>
<tr class="separator:gacbf0bfedc6677ca8357d8b345c9026c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83ca81f98ff7d1c4212a5ebdcab638fb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga83ca81f98ff7d1c4212a5ebdcab638fb">rt_mq_send</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq, void *buffer, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> size)</td></tr>
<tr class="separator:ga83ca81f98ff7d1c4212a5ebdcab638fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29ff4d36285c0d81eb19a9fd03708e18"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga29ff4d36285c0d81eb19a9fd03708e18">rt_mq_urgent</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq, void *buffer, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> size)</td></tr>
<tr class="separator:ga29ff4d36285c0d81eb19a9fd03708e18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a676c587c7b403b2585a7152905e39a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga1a676c587c7b403b2585a7152905e39a">rt_mq_recv</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq, void *buffer, <a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> size, <a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a> timeout)</td></tr>
<tr class="separator:ga1a676c587c7b403b2585a7152905e39a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6956acd1324f5e8ebc7946c13152707f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___i_p_c.html#ga6956acd1324f5e8ebc7946c13152707f">rt_mq_control</a> (<a class="el" href="structrt__messagequeue.html">rt_mq_t</a> mq, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> cmd, void *arg)</td></tr>
<tr class="separator:ga6956acd1324f5e8ebc7946c13152707f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>RT-Thread operating system supports the traditional semaphore and mutex.</p>
<ul>
<li>Mutex objects use inherited priority to prevent priority reversion.</li>
<li>The semaphore release action is safe for interrupt service routine.</li>
</ul>
<p>Moreover, the blocked queue for thread to obtain semaphore or mutex can be sorted by priority or FIFO. There are two flags to indicate this mechanism.</p>
<ul>
<li>RT_IPC_FLAG_FIFO when the resource is available, thread pended on this resource at first would get the resource.</li>
<li>RT_IPC_FLAG_PRIO when the resource is available, thread pended on this resource who had the most high priority would get the resource.</li>
</ul>
<p>RT-Thread operating systems supports event/fast event, mail box and message queue.</p>
<ul>
<li>The event mechanism is used to awake a thead by setting one or more corresponding bit of a binary number when an event ocurs.</li>
<li>The fast event supports event thread queue. Once a one bit event occurs, the corresponding blocked thread can be found out timing accurately, then will be waked up.</li>
<li>In mailbox, the mail length is fixed to 4 byte, which is more effective than message queue.</li>
<li>The send action for communication facilities is also safe for interrupt service routine. </li>
</ul>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga1b618f6714ea8f49a45ea4d105aaf5d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_IPC_FLAG_FIFO&#160;&#160;&#160;0x00</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>IPC flags and control command definitionsFIFOed IPC. <a class="el" href="group___i_p_c.html">Inter-Thread Communication</a>. </p>

</div>
</div>
<a class="anchor" id="ga296aeeb69fe2c8c5012e1059df4364a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_IPC_FLAG_PRIO&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>PRIOed IPC. <a class="el" href="group___i_p_c.html">Inter-Thread Communication</a>. </p>

</div>
</div>
<a class="anchor" id="gae7ea862e2d1edce01e015bdffe49d586"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_IPC_CMD_UNKNOWN&#160;&#160;&#160;0x00</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>unknown IPC command </p>

</div>
</div>
<a class="anchor" id="ga947606ce2a31a2d70e287c38a09dab3b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_IPC_CMD_RESET&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>reset IPC object </p>

</div>
</div>
<a class="anchor" id="ga923d8e409f9daa8843978d6805ebcdeb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_WAITING_FOREVER&#160;&#160;&#160;-1</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Block forever until get resource. </p>

</div>
</div>
<a class="anchor" id="ga78a487898fe750a9f7e9c37911fbe7cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_WAITING_NO&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Non-block. </p>

</div>
</div>
<a class="anchor" id="ga449614d0024ade7e81e53462bce12a60"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_EVENT_FLAG_AND&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>flag defintions in eventlogic and </p>

</div>
</div>
<a class="anchor" id="ga1685d2d8ef3af705fdc297405eda02ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_EVENT_FLAG_OR&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>logic or </p>

</div>
</div>
<a class="anchor" id="gaf1c42d6c619445f9151e76c3242ef052"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_EVENT_FLAG_CLEAR&#160;&#160;&#160;0x04</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>clear flag </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gacb55d0444383689161388fe89f415e92"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_ipc_object_init </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structrt__ipc__object.html">rt_ipc_object</a> *&#160;</td>
          <td class="paramname"><em>ipc</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize an IPC object</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ipc</td><td>the IPC object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga76ac02d6065733bd88ad9c225d17d7cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_ipc_list_suspend </td>
          <td>(</td>
          <td class="paramtype">rt_list_t *&#160;</td>
          <td class="paramname"><em>list</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structrt__thread.html">rt_thread</a> *&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will suspend a thread to a specified list. IPC object or some double-queue object (mailbox etc.) contains this kind of list.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">list</td><td>the IPC suspended thread list </td></tr>
    <tr><td class="paramname">thread</td><td>the thread object to be suspended </td></tr>
    <tr><td class="paramname">flag</td><td>the IPC object flag, which shall be RT_IPC_FLAG_FIFO/RT_IPC_FLAG_PRIO.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga3305383c1afa8b8d6077d9a43fc05697"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_ipc_list_resume </td>
          <td>(</td>
          <td class="paramtype">rt_list_t *&#160;</td>
          <td class="paramname"><em>list</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will resume the first thread in the list of a IPC object:</p>
<ul>
<li>remove the thread from suspend queue of IPC object</li>
<li>put the thread into system ready queue</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">list</td><td>the thread list</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga9aff869d3f5db5c1788b45bb6feb9b4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rt_inline <a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_ipc_list_resume_all </td>
          <td>(</td>
          <td class="paramtype">rt_list_t *&#160;</td>
          <td class="paramname"><em>list</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will resume all suspended threads in a list, including suspend list of IPC object and private list of mailbox etc.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">list</td><td>of the threads to resume</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga023e00dd1ae86ddbeb2dbf92771e17ea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize a semaphore and put it under control of resource management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object </td></tr>
    <tr><td class="paramname">name</td><td>the name of semaphore </td></tr>
    <tr><td class="paramname">value</td><td>the init value of semaphore </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of semaphore</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga7dd3560a50be21e132c71f622870c500"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a semaphore from resource management</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga0e45d2b96aab649832b6756d68629bbe">rt_sem_delete</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga61a4960ff4a173f1d1c35ede42e1227f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__semaphore.html">rt_sem_t</a> rt_sem_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create a semaphore from system resource</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of semaphore </td></tr>
    <tr><td class="paramname">value</td><td>the init value of semaphore </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of semaphore</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created semaphore, RT_NULL on error happen</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga023e00dd1ae86ddbeb2dbf92771e17ea">rt_sem_init</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga0e45d2b96aab649832b6756d68629bbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete a semaphore object and release the memory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga7dd3560a50be21e132c71f622870c500">rt_sem_detach</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gaad0807b1eb15fe12a67de122e28f20eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_take </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will take a semaphore, if the semaphore is unavailable, the thread shall wait for a specified time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object </td></tr>
    <tr><td class="paramname">time</td><td>the waiting time</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gaf24da991e29df68a49062d89b95c7de5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_trytake </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will try to take a semaphore and immediately return</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gad9a5760bc4c7faeb08a7d9c112506f76"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_release </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will release a semaphore, if there are threads suspended on semaphore, it will be waked up.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga4f05b6881e0d7c456b7bc1412fa73392"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_sem_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__semaphore.html">rt_sem_t</a>&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can get or set some extra attributions of a semaphore object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>the semaphore object </td></tr>
    <tr><td class="paramname">cmd</td><td>the execution command </td></tr>
    <tr><td class="paramname">arg</td><td>the execution argument</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga90c29e470fff8981a976ec7f9bb0546e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize a mutex and put it under control of resource management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object </td></tr>
    <tr><td class="paramname">name</td><td>the name of mutex </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of mutex</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga7a8b48c0e6884e2c22d08e9e7e98a613"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a mutex from resource management</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga8a74f51362fc566500bec135599dd5a9">rt_mutex_delete</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga5ce96ed48d83086aab6ecadebac6d0c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__mutex.html">rt_mutex_t</a> rt_mutex_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create a mutex from system resource</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of mutex </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of mutex</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created mutex, RT_NULL on error happen</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga90c29e470fff8981a976ec7f9bb0546e">rt_mutex_init</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga8a74f51362fc566500bec135599dd5a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete a mutex object and release the memory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___i_p_c.html#ga7a8b48c0e6884e2c22d08e9e7e98a613">rt_mutex_detach</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga77845c9c0da68d07225c4c4699f114f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_take </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will take a mutex, if the mutex is unavailable, the thread shall wait for a specified time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object </td></tr>
    <tr><td class="paramname">time</td><td>the waiting time</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gad49c2ee6dc578e6687919f01a4ac5137"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_release </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will release a mutex, if there are threads suspended on mutex, it will be waked up.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gadf759ed1d28b25c78893aa4236e2e7b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mutex_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mutex.html">rt_mutex_t</a>&#160;</td>
          <td class="paramname"><em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can get or set some extra attributions of a mutex object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>the mutex object </td></tr>
    <tr><td class="paramname">cmd</td><td>the execution command </td></tr>
    <tr><td class="paramname">arg</td><td>the execution argument</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gab0fad38227b1ebd616a807a09f2eb772"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_init </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize an event and put it under control of resource management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the event object </td></tr>
    <tr><td class="paramname">name</td><td>the name of event </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga43f0b137c7e6d5c2152f6b1d39b57616"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_detach </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach an event object from resource management</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the event object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga3d752d98e73c0adcdd2b0df24e67efdb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rt_event_t rt_event_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create an event object from system resource</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of event </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created event, RT_NULL on error happen </dd></dl>

</div>
</div>
<a class="anchor" id="ga840d6210713f186fe248a032a68d5e6d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_delete </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete an event object and release the memory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the event object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga92efdf32aaf073d733f3bafd02d730e5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_send </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will send an event to the event object, if there are threads suspended on event object, it will be waked up.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the event object </td></tr>
    <tr><td class="paramname">set</td><td>the event set</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga77e0517918bc7dabd458c2a751a59263"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_recv </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>option</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> *&#160;</td>
          <td class="paramname"><em>recved</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will receive an event from event object, if the event is unavailable, the thread shall wait for a specified time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the fast event object </td></tr>
    <tr><td class="paramname">set</td><td>the interested event set </td></tr>
    <tr><td class="paramname">option</td><td>the receive option, either RT_EVENT_FLAG_AND or RT_EVENT_FLAG_OR should be set. </td></tr>
    <tr><td class="paramname">timeout</td><td>the waiting time </td></tr>
    <tr><td class="paramname">recved</td><td>the received event</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gafb0ca02b1983270b2cc911d6c5682ed0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_event_control </td>
          <td>(</td>
          <td class="paramtype">rt_event_t&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can get or set some extra attributions of an event object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>the event object </td></tr>
    <tr><td class="paramname">cmd</td><td>the execution command </td></tr>
    <tr><td class="paramname">arg</td><td>the execution argument</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gac05bd0c179f754c32f83a7b013e8953b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msgpool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize a mailbox and put it under control of resource management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object </td></tr>
    <tr><td class="paramname">name</td><td>the name of mailbox </td></tr>
    <tr><td class="paramname">msgpool</td><td>the begin address of buffer to save received mail </td></tr>
    <tr><td class="paramname">size</td><td>the size of mailbox </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of mailbox</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga3312c6094d9c21af33a74f444a8c5993"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a mailbox from resource management</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga7719d644b6f58399894dec1c6353ac37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a> rt_mb_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create a mailbox object from system resource</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of mailbox </td></tr>
    <tr><td class="paramname">size</td><td>the size of mailbox </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of mailbox</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created mailbox, RT_NULL on error happen </dd></dl>

</div>
</div>
<a class="anchor" id="ga71e9e49401cbbed83515ace6fa13c27b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete a mailbox object and release the memory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gab212d0f70fbf7ac83a2ba6b1f5e4e938"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_send_wait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will send a mail to mailbox object. If the mailbox is full, current thread will be suspended until timeout.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object </td></tr>
    <tr><td class="paramname">value</td><td>the mail </td></tr>
    <tr><td class="paramname">timeout</td><td>the waiting time</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga9d800aa0faa0ab5ccd3b0e75837db047"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will send a mail to mailbox object, if there are threads suspended on mailbox object, it will be waked up. This function will return immediately, if you want blocking send, use rt_mb_send_wait instead.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object </td></tr>
    <tr><td class="paramname">value</td><td>the mail</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga363ad0b0f09a2b1f62dad79199c4d717"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_recv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a> *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will receive a mail from mailbox object, if there is no mail in mailbox object, the thread shall wait for a specified time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object </td></tr>
    <tr><td class="paramname">value</td><td>the received mail will be saved in </td></tr>
    <tr><td class="paramname">timeout</td><td>the waiting time</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gaebd2849f8d9fcc6645191eb22508e798"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mb_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__mailbox.html">rt_mailbox_t</a>&#160;</td>
          <td class="paramname"><em>mb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can get or set some extra attributions of a mailbox object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mb</td><td>the mailbox object </td></tr>
    <tr><td class="paramname">cmd</td><td>the execution command </td></tr>
    <tr><td class="paramname">arg</td><td>the execution argument</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="gaac5b76df894964c908271ab0951f7e86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msgpool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>msg_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>pool_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize a message queue and put it under control of resource management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message object </td></tr>
    <tr><td class="paramname">name</td><td>the name of message queue </td></tr>
    <tr><td class="paramname">msgpool</td><td>the beginning address of buffer to save messages </td></tr>
    <tr><td class="paramname">msg_size</td><td>the maximum size of message </td></tr>
    <tr><td class="paramname">pool_size</td><td>the size of buffer to save messages </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of message queue</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga1ed6238494fac3ab081a90d9c563a8f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a message queue object from resource management</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the operation status, RT_EOK on successful </dd></dl>

</div>
</div>
<a class="anchor" id="ga35acff654ecee2a76d5555e9683d8470"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a> rt_mq_create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>msg_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>max_msgs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will create a message queue object from system resource</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the name of message queue </td></tr>
    <tr><td class="paramname">msg_size</td><td>the size of message </td></tr>
    <tr><td class="paramname">max_msgs</td><td>the maximum number of message in queue </td></tr>
    <tr><td class="paramname">flag</td><td>the flag of message queue</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the created message queue, RT_NULL on error happen </dd></dl>

</div>
</div>
<a class="anchor" id="gacbf0bfedc6677ca8357d8b345c9026c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete a message queue object and release the memory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga83ca81f98ff7d1c4212a5ebdcab638fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will send a message to message queue object, if there are threads suspended on message queue object, it will be waked up.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object </td></tr>
    <tr><td class="paramname">buffer</td><td>the message </td></tr>
    <tr><td class="paramname">size</td><td>the size of buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga29ff4d36285c0d81eb19a9fd03708e18"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_urgent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will send an urgent message to message queue object, which means the message will be inserted to the head of message queue. If there are threads suspended on message queue object, it will be waked up.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object </td></tr>
    <tr><td class="paramname">buffer</td><td>the message </td></tr>
    <tr><td class="paramname">size</td><td>the size of buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga1a676c587c7b403b2585a7152905e39a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_recv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will receive a message from message queue object, if there is no message in message queue object, the thread shall wait for a specified time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object </td></tr>
    <tr><td class="paramname">buffer</td><td>the received message will be saved in </td></tr>
    <tr><td class="paramname">size</td><td>the size of buffer </td></tr>
    <tr><td class="paramname">timeout</td><td>the waiting time</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
<a class="anchor" id="ga6956acd1324f5e8ebc7946c13152707f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> rt_mq_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structrt__messagequeue.html">rt_mq_t</a>&#160;</td>
          <td class="paramname"><em>mq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can get or set some extra attributions of a message queue object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mq</td><td>the message queue object </td></tr>
    <tr><td class="paramname">cmd</td><td>the execution command </td></tr>
    <tr><td class="paramname">arg</td><td>the execution argument</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 6 2014 23:05:02 for RT-Thread RTOS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
